package net.disy.cadenza.repository.workflow;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class ResultSourceData {
	public static String RESULT_SOURCE_DATA_TYPE = "type";
	public static String RESULT_SOURCE_SELECTOR_NAME = "selectorName";
	public static String RESULT_SOURCE_REPOSITORY_LOCATION = "repositoryLocation";
	private String type;
	private String selectorName;
	private String repositoryLocation;
	
	public ResultSourceData(Node resultSourceDataNode){
		NamedNodeMap namedNodeMap = resultSourceDataNode.getAttributes();
		Node attrNode = namedNodeMap.getNamedItem(RESULT_SOURCE_DATA_TYPE);
		type = (attrNode != null) ? attrNode.getNodeValue() : "";
		attrNode = namedNodeMap.getNamedItem(RESULT_SOURCE_SELECTOR_NAME);
		selectorName = (attrNode != null) ? attrNode.getNodeValue() : "";
		attrNode = namedNodeMap.getNamedItem(RESULT_SOURCE_REPOSITORY_LOCATION);
		repositoryLocation = (attrNode != null) ? attrNode.getNodeValue() : "";
	}

	public String getType() {
		return type;
	}

	public String getSelectorName() {
		return selectorName;
	}

	public String getRepositoryLocation() {
		return repositoryLocation;
	}
	
	
}
